import request from '@/utils/request'
// 获取用户信息
export const user = params => {
  return request({
    method: 'GET',
    url: '/users',
    params
  })
}

// 权限组列表
export const permissions = params => {
  return request({
    method: 'GET',
    url: '/permissions',
    params
  })
}
// 删除权限列表   
export const dellPer = id => {
  return request({
    method: 'DELETE',
    url: `/permissions/${id}`,
  })
}
// 根据id权限列表
export const idPermi = id => {
  return request({
    method: 'GET',
    url: `/users/${id}`,
  })
}
//权限新增
export const addPer = data => {
  return request({
    method: 'POST',
    url: '/permissions',
    data
  })
}
// 编辑权限列表
export const editPerMi = (id, data) => {
  return request({
    method: 'PUT',
    url: `/permissions/${id}`,
    data
  })
}
// 新增用户
export const addUser = data => {
  return request({
    method: 'POST',
    url: '/users',
    data
  })
}
// 根据id查找用户
export const idUser = id => {
  return request({
    method: 'GET',
    url: `/users/${id}`,
  })
}
//用户修改
export const putUser = (id, data) => {
  return request({
    method: 'PUT',
    url: `/users/${id}`,
    data
  })
}

// 删除用户
export const dellUser = id => {
  return request({
    method: 'DELETE',
    url: `/users/${id}`,
  })
}
// 日志信息
export const profile = () => {
  return request({
    method: 'POST',
    url: '/frame/profile',
  })
}
